package lapsnake.model;

import java.beans.PropertyVetoException;

import lapsnake.model.data.ChildField;

import org.python.antlr.base.expr;


/**Ancestor for all expression-statements*/
public abstract class LapExpression extends LapStatement {
	public LapExpression(PyAST pyAST, ChildField<?> parentField, expr node) throws PropertyVetoException {
		super(pyAST, parentField, node);
	}
	/**Returns whether the expression is actually an expression-statement. This is determined by its field on the parent node.
	 * In the "native" python AST an "Expr" node would serve as an interlink here, 
	 * but this has been removed to make things appear as simple as possible from the outside.*/
	public boolean isStatement()
	{
		return !LapExpression.class.isAssignableFrom(parentField.getType());
	}
}
